﻿using System;

namespace LearnAbstract
{
    class Program
    {
        static void Main(string[] args)
        {
            Son s = new Son();
            s.DoSomething();
            s.OnCall();

            Console.ReadKey();
        }

        interface People
        {
            string Name { get; set; }

            int ID { get; set; }
        }

        abstract class Father : People   //定义abstract Father
        {
            public Father()
            {
                Console.WriteLine($"{nameof(Father)}.构造函数");
            }

            public int ID { get; set; }    //抽象类中直接实现接口People.ID属性

            public abstract string Name { get; set; } //抽象类中用抽象方法实现，交由派生类自己实现

            public abstract void DoSomething();

            public void OnCall()
            {
                Console.WriteLine("OnCall...");
            }
        }

        class Son : Father //继承 abstract  Father 
        {
            public override string Name { get; set; }

            public override void DoSomething()
            {
                Console.WriteLine($"{nameof(Son)}.Learn");
            }
        }
    }
}
